package com.example.demo.service;

import com.example.demo.entity.StudentInfo;
import com.example.demo.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class StudentServicelmpl implements StudentInfoService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<StudentInfo> getallstudentinfo() {
        return studentMapper.getallstudentinfo();
    }

    @Override
    public int insertstudentinfo(StudentInfo studentInfo) {

        return studentMapper.insertstudentinfo(studentInfo);
    }

    @Override
    public int updatesstudentinfo(StudentInfo studentInfo) {
        System.out.println("up");
        return studentMapper.updatestudentinfo(studentInfo);
    }

    @Override
    public int deletestudentinfo(int id) {
        return studentMapper.deletestudentinfo(id);
    }

    @Override
    public StudentInfo getstudentinfo(int id) {
        StudentInfo getstudentinfobyid = studentMapper.getstudentinfo(id);
        return getstudentinfobyid;
    }
}
